package com.bihucms.ssm.service.user.impl;

import com.bihucms.ssm.dao.UserMapper;
import com.bihucms.ssm.model.User;
import com.bihucms.ssm.service.user.UserService;
import com.bihucms.ssm.util.BihuUtil;
import com.bihucms.ssm.util.MD5Util;
import com.bihucms.ssm.util.StaticFinalVar;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created by Zhangxq on 2016/7/15.
 */

@Service
@Transactional(rollbackFor = Exception.class)
public class UserServiceImpl implements UserService {
    
    @Resource
    private UserMapper userMapper;

    @Override
    public User toLogin(User user) {

        user.setUserPassword(MD5Util.md5(user.getUserPassword()+ StaticFinalVar.YAN));

        return userMapper.toLogin(user);
    }
}
